#include "abstractappsettingsstorage.h"
#include "appsettingsstrorage.h"
#include <QGuiApplication>
#include <QQmlApplicationEngine>
#include <QQmlContext>
#include "connectionparammodel.h"
#include "parametrscontroller.h"

INJECT_DEPENDENCY_TO_SINGLETONE(AbstractAppSettingsStorage, new AppSettingsStrorageByQSettings(qApp))

int main(int argc, char *argv[])
{
    QGuiApplication app(argc, argv);
		QCoreApplication::setOrganizationName(QObject::trUtf8("Василий Почкаенко"));
		QCoreApplication::setApplicationName(QObject::trUtf8("Singletone excaption 1"));

		ConnectionParamModel m;
		ParametrsController pc(&m);

		QQmlApplicationEngine engine;
		engine.rootContext()->setContextProperty("parametrsController", &pc);
		engine.rootContext()->setContextProperty("connectionParamModel", &m);
    engine.load(QUrl(QStringLiteral("qrc:///main.qml")));

    return app.exec();
}
